package com.yhgm.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yhgm.common.BaseResponse;
import com.yhgm.pojo.Image;
import io.swagger.models.auth.In;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * @Author ZY
 * @Date 2024/4/26 14:06
 */
@Mapper
public interface ImageMapper extends BaseMapper<Image> {
    List<Image> listFile(String url);

    @Update("update image set delType = 2 where id = #{id}")
    Integer delFile(Long id);

    List<Image> listRecycle(String path);

    @Update("update image set delType = 1 where id = #{id}")
    Integer recoverImage(Long id);

    @Delete("delete from image where id = #{id}")
    Integer delRecycle(Long id);

    List<Image> findByCondition(Image image);

    List<Image> findByPath(String path,Integer i);
}
